package com.panghl.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.panghl.model.entity.SysAttach;
import com.panghl.model.vo.SysFileVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public interface ISysAttachService extends IService<SysAttach> {
    /**
     * 文件上传
     *
     * @param file 文件对象
     */
    SysFileVO upload(MultipartFile file);

    /**
     * 文件下载
     *
     * @param filePath 文件路径
     * @param response 响应对象
     */
    Boolean download(String filePath, HttpServletResponse response);

    /**
     * 文件预览
     *  @param filePath 文件路径
     * @param type 文件类型
     * @param response 响应对象
     */
    Boolean preview(String filePath, String type, HttpServletResponse response);

    /**
     * 预览
     * @param filePath
     * @param type
     * @param response
     * @param request
     */
    void preview2(String filePath, String type, HttpServletResponse response, HttpServletRequest request);

    /**
     * 文件删除
     *
     * @param filePath 文件路径
     */
    Boolean deleteFile(String filePath);

}
